<template>
  <div class="add-form" >
    <el-dialog title="预览文章" :visible="dialogVisible" @close="CloseFn" >
     <div class="title">
        <h2>{{PreviewTable.title}}</h2>
      <span>{{PreviewTable.createTime}}</span>
      <span>{{PreviewTable.username}}</span>
      <span class="el-icon-view"></span>
      <span>{{PreviewTable.visits}}</span>
      <div class="PreviewTable_box">
        <div  v-html="PreviewTable.articleBody">
        </div>
      </div>
     </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: 'ArticlesPreview',

  props: {
    // 父传子-控制弹窗显示
    dialogVisible: {
      type: Boolean,
      default: false
    },
    // 父亲传进来的数据详情
    PreviewTable: {
      type: Object,
      default: _ => {}
    }
  },
  data () {
    return {

    }
  },
  methods: {
    // 弹框关闭
    CloseFn () {
      this.$emit('update:dialogVisible', false)
    }
  }
}
</script>

<style scoped >
.add-form >>>.el-dialog{
width: 800px;
}
h2{
  margin: 0;
}
span{
  margin: 10px;
}
.PreviewTable_box{
  padding:15px 10px ;
  background-color:#f5f5f5;
  border-top:1.5px dashed #ccc ;
  font-size: 16px;
}

</style>
